<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>书籍管理</title>
<link rel="stylesheet" type="text/css" href="../ui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../ui/themes/icon.css">
<script type="text/javascript" src="../ui/jquery.min.js"></script>
<script type="text/javascript" src="../ui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../ui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../ui/jquery.serializejson.min.js"></script>
<%--<script type="text/javascript" src="../ui/date.js"></script>--%>
<%--<script type="text/javascript" src="../js/crud.js"></script>--%>
<script type="text/javascript">
	var name="product";
	var height = 300;
	var width = 500;
	var columns=[[
	  		    {field:'pid',title:'编号',width:100},
	  		    {field:'pname',title:'书名',width:100},
	  		    {field:'market_price',title:'进货价',width:100},
	  		    {field:'shop_price',title:'商城价',width:100},
	  		    {field:'is_hot',title:'是否热门',width:100,formatter:function(value, row, index){
	  		    	//value = row.gender;
	  		    	if(1 == value * 1){
	  		    		return '是';
	  		    	}
	  		    	if(0 == value * 1){
	  		    		return '否';
	  		    	}
	  		    }},
				{title:'图片',field:'image',width:100,align:'center',
				formatter:function(value,row,index)
				{return '<img src=basePath+"/products/1/cs10001.jpg" />';}
				},
	  		    {field:'pdesc',title:'描述',width:100},
	  		    {field:'pdate',title:'上架上架',width:100,formatter:function(value){
	  		        return new Date(value).Format("yyyy-MM-dd");
	  		    }},
	  		    {field:'categorySecond.csname',title:'所属二级分类',width:100,formatter:function(value){
	  		    	return value;
	  		    }},

				{field:'-',title:'操作',width:200,formatter: function(value,row,index){
					var oper = "<a href=\"javascript:void(0)\" onclick=\"edit(" + row.pid + ')">修改</a>';
					oper += ' <a href="javascript:void(0)" onclick="del(' + row.pid + ')">删除</a>';
					return oper;
				}}
				]];

</script>
</head>
<body>
<div class="easyui-panel" style="padding-left:4px;border-bottom:0px;">
	<div style="height:2px;"></div>
	<form id="searchForm">
	书名：<input name="pname" >
	是否热门：<select name="is_hot">
				<option value="" >-请选择-</option>
				<option value="1" >是</option>
				<option value="0" >否</option>
			</select>
	上架时间：<input name="Product1.pdate" editable="false" class="easyui-datebox"> 到 <input name="Product2.pdate" editable="false" class="easyui-datebox">
	<br/>所属二级分类：<input name="categorySecond.csid" editable="false" class="easyui-combobox" data-options="
					url:'categorySecond_getlist', textField:'csname', valueField:'csid'
				">

		<button type="button" id="btnSearch">查询</button>
	</form>
	<div style="height:2px;"></div>
</div>
<table id="grid"></table>

<div id="editDlg">
	<form id="editForm">
		<table>
			<tr><input name="pid" type="hidden"/> 
				<td>书名</td><td><input type="text" name="pname" class="easyui-validatebox" data-options="
					required:true,missingMessage:'书名不能为空!'
					">
				</td>
			</tr>
			<tr>
				<td>进货价</td><td><input type="text" name="market_price" class="easyui-validatebox" data-options="
					required:true,missingMessage:'进货价不能为空!'"> </td>
			</tr>
			<tr>
				<td>商城价</td><td><input type="text" name="shop_price" class="easyui-validatebox" data-options="
					required:true,missingMessage:'商城价不能为空!'"> </td>
			</tr>				
			<tr>
				<td>是否热门</td>
				<td>
					<select name="is_hot" class="easyui-validatebox" required=true>
				<option value="" >-请选择-</option>
				<option value="1" >是</option>
				<option value="0" >否</option>
			</select>
				</td>
			</tr>
			<tr>
				<td>描述</td><td><input type="text" name="pdesc" required=true class="easyui-validatebox" > </td>
			</tr>
			<tr>
				<td>书的图片</td><td><input type="file" name="tele"> </td>
			</tr>
			<tr>
				<td>上架时间</td><td><input type="text" name="pdate" class="easyui-datebox" editable="false"> </td>
			</tr>
			<tr>
				<td>所属二级分类：</td><td><input name="categorySecond.csid" editable="false" class="easyui-combobox" data-options="
					url:'categorySecond_getlist', textField:'csname', valueField:'csid'
				"> </td>
			</tr>

		</table>
		<button id="btnSave" type="button">保存</button>
	</form>
</div>

</body>
</html>

